package net.xdclass.rbac_shiro.controller;

import net.xdclass.rbac_shiro.domain.JsonData;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: rbac_shiro
 * @description: 登出操作
 * @author: rZ
 * @create: 2020-01-13 11:23
 **/
@RestController
public class LogoutController {

    @RequestMapping("/logout")
    public JsonData findMyPlayRecord(){

        Subject subject = SecurityUtils.getSubject();
        if(subject.getPrincipals() != null ){

        }
        SecurityUtils.getSubject().logout();
        return JsonData.buildSuccess("logout成功");

    }

}
